<template>
<el-form :date="tableData"  ref="ruleForm" label-width="100px" class="demo-ruleForm" style="width:40%;margin:0 auto" >
  <el-form-item label="企业编号" prop="companyCode" >
    <el-input v-model="tableData.companyCode" readonly ></el-input>
  </el-form-item>
  <el-form-item label="企业名称" prop="companyName">
    <el-input v-model="tableData.companyName" readonly></el-input>
  </el-form-item>
  <el-form-item label="证件类型" prop="idType" readonly >
    <el-input v-model="tableData.idType" placeholder="请输入证件类型">
      
    </el-input>
  </el-form-item>
   <el-form-item label="证件号码" prop="idNumber">
    <el-input v-model="tableData.idNumber" readonly></el-input>
  </el-form-item>
  <el-form-item label="企业成立日期" readonly required>
    <el-col :span="11">
      <el-form-item prop="createDate" readonly>
        <el-date-picker type="date" placeholder="选择日期" v-model="tableData.createDate" style="width: 100%;" readonly></el-date-picker>
      </el-form-item>
    </el-col>
  </el-form-item>

  <el-form-item label="注册资本（万元）" prop="registerCapital">
    <el-input v-model="tableData.registerCapital" readonly></el-input>
  </el-form-item>
  <el-form-item label="详细地址" prop="companyAddress">
    <el-input v-model="tableData.companyAddress" readonly></el-input>
  </el-form-item>
  <el-form-item label="职工人数" prop="empNumber">
    <el-input v-model="tableData.empNumber" readonly></el-input>
  </el-form-item>
  <el-form-item label="登记日期" prop="registerDate">
    <el-input v-model="tableData.registerDate" readonly></el-input>
  </el-form-item>
  <el-form-item label="更新日期" prop="updateDate">
    <el-input v-model="tableData.updateDate" readonly></el-input>
  </el-form-item>
  
 
  <el-form-item>
   <el-button type="primary" @click="returnIndex">返回企业列表</el-button>  

  </el-form-item>
</el-form>
</template>
<script>
import {messagedetailToShow} from '@/api/message/index'
  export default {
    data() {
      return {
        ruleForm: {
          name: '',
          region: '',
          date1: '',
          date2: '',
          delivery: false,
          type: [],
          resource: '',
          desc: ''
        },
        tableData:[]
      };
    },
    props:{
      companyCode :  {
        type: String,
        default: ""
      },
    },
    methods: {
      submitForm(formName) {
        this.$refs[formName].validate((valid) => {
          if (valid) {
            alert('submit!');
          } else {
            console.log('error submit!!');
            return false;
          }
        });
      }, 
     
       returnIndex(){
         this.$router.replace('/message')
       },
        showmessagedetail(){
        messagedetailToShow(this.companyCode).then(res => {
           this.tableData = res
        }).catch((e) => {console.log(e )})
      }
    },
    mounted(){
      this.showmessagedetail()
    }
  }
</script>



<style>
.el-input__inner{

  border:transprant
}
</style>